<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.5/css/bootstrap.min.css">
    <script src="//cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
    <script src="//cdn.bootcss.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
</head>


<div id="tables">

</div>
<script>

    var wsServer = 'ws://127.0.0.1:10000';
    var websocket = new WebSocket(wsServer);

    websocket.onopen = function (evt) {
        console.log("Connected to WebSocket server.");
        websocket.send('{"cmd":"sh shell.sh", "is_block":1}');
        websocket.send('{"cmd":"info", "is_block":1}');
        websocket.send('{"cmd":"quit", "is_block":1}');
        websocket.send('{"cmd":"exit", "is_block":1}');
    };
    websocket.onclose = function (evt) {
        console.log("Disconnected");
    };
    websocket.onmessage = function (evt) {
        console.log('Retrieved data from server: ' + evt.data);
    };
    websocket.onerror = function (evt, e) {
        console.log('Error occured: ' + evt.data);
    };

</script>
</body>
</html>